//
//  LYDb.h
//  LeYou_demo
//
//  Created by naffan on 12-11-20.
//  Copyright (c) 2012年 naffan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "LYConstants.h"
#import "FMDatabase.h"
#import "sqlite3.h"
@interface LYDb : NSObject
{
    sqlite3 *database;
    sqlite3_stmt *statement;
    char *errorMsg;
    FMDatabase *db;
    FMResultSet *rs;
}
-(FMDatabase*)open;
-(BOOL)create;
-(BOOL)insert:(NSString*)username loginflag:(NSInteger*)loginflag ordernum:(NSInteger*)ordernum;
-(BOOL)update:(NSString*)username loginflag:(NSInteger*)loginflag ordernum:(NSInteger*)ordernum;
-(NSMutableDictionary*)selectAll;
-(void)query;
-(void)delete;

-(BOOL)update_back:(NSString*)sql;
-(NSString*)query_back:(NSString*)sql column:(NSString*)colunm;
-(BOOL)insert_back:(NSString*)sql;
-(BOOL)create_back:(NSString*)sql;
@end
